<?php
    session_start();
    if($_SESSION['uid']==""||$_SESSION['level']!=3){
		header("Location: ./login.php");
		exit();
	}
	
?>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->

<!--/meta 作为公共模版分离出去-->
<title>公寓管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 公寓管理 <span class="c-gray en">&gt;</span> 公寓信息修改 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
	<div class="cl pd-5 mybg-2 bk-gray mb-10">
			<span class="r">
				<button onclick="removeIframe()" class="btn btn-primary radius">关闭选项卡</button>
				 <!--<a href="javascript:;" onclick="datadel()" class="btn btn-danger radius">
				 <i class="Hui-iconfont">&#xe6e2;</i> 批量删除
				 </a>
				 <a class="btn btn-primary radius" data-title="添加公寓" data-href="apartment-add.html" onclick="Hui_admin_tab(this)" href="javascript:;">
					 <i class="Hui-iconfont">&#xe600;</i> 添加公寓
				 </a>-->
			</span>
	</div>
	<div class="form form-horizontal mybg-2 bk-gray" id="form-article-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>公寓编号：</label>
			<div class="formControls col-xs-8 col-sm-3">
				<input type="number" id="id" name="id" disabled="disabled" class="input-text" style="width:100%" value="" placeholder="只允许数字">
				<label id="id-error" class="error valid" for="id" style="display:none;">这是必填字段</label>
            </div>
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>公寓名称：</label>
			<div class="formControls col-xs-8 col-sm-4">
				<input type="text" id="name" name="name" class="input-text" value="" placeholder="不超过二十个字">
				<label id="name-error" class="error valid" for="name" style="display:none;">这是必填字段</label>
			</div>
		</div>
		<div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>楼层数：</label>
			<div class="formControls col-xs-8 col-sm-3">
				<input type="number" id="floor" name="floor" disabled="disabled" class="input-text" style="width:100%;" value="" placeholder="只允许数字">
				<label id="floor-error" class="error valid" for="floor" style="display:none;">这是必填字段</label>
			</div>
			<label class="form-label col-xs-4 col-sm-2">公寓简称：</label>
			<div class="formControls col-xs-8 col-sm-4">
				<input type="text" id="abbreviation" name="abbreviation" class="input-text" value="" placeholder="不超过十个字">
				<label id="abbreviation-error" class="error valid" for="abbreviation" style="display:none;">超出字数限制</label>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">公寓分类：</label>
            <div class="formControls col-xs-8 col-sm-3">
				<select id="property" class="select" size="1" style="height:29px;">
					<option value="1" selected="">女生宿舍楼</option>
                    <option value="2">男生宿舍楼</option>
                    <option value="3">混合宿舍楼</option>
				</select>
			</div>
			<label class="form-label col-xs-4 col-sm-2">公寓状态：</label>
            <div class="formControls col-xs-8 col-sm-4">
				<select id="status" class="select" size="1" style="height:29px;">
					<option value="1" selected="">使用</option>
                    <option value="0">停用</option>
				</select>
            </div>
		</div>
        
        <div class="row cl">
            <label id="label-floor" class="form-label col-xs-4 col-sm-2">折叠/展开：</label>
            <div id="div-floor" class="formControls col-xs-8 col-sm-9">
                    <table class="table table-border table-bordered table-bg">
                            <thead>
                                <tr>
                                    <th colspan="7" scope="col">楼层设置</th>
                                </tr>
                                <tr class="text-c">
                                    <th>第/层</th>
                                    <th>房间数</th>
									<th>标准床位数</th>
									<th>楼层分类</th>
									<th>该层状态</th>
									<th>备注</th>
									<th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="display-floor">
                                <tr class="text-c">
                                    <td>
                                        1
                                    </td>
                                    <td>
										<input type="number" id="floor_rooms" class="input-text" style="width:100%;" value="" placeholder="">
										<label id="floor_rooms-error" class="error valid" for="floor_rooms" style="display:none;">不能为空</label>
                                    </td>
                                    <td>
										<input type="number" id="floor_beds" class="input-text" style="width:100%;" value="" placeholder="">
										<label id="floor_beds-error" class="error valid" for="floor_beds" style="display:none;">不能为空</label>
									</td>
									<td>
										<select id="floor_property" class="select" size="1" style="height:31px;">
                                            <option value="1" selected="">女生</option>
											<option value="2">男生</option>
											<option value="3">混合</option>
										</select>
										<label id="floor_property-error" class="error valid" for="floor_property" style="display:none;">只允许</label>
									</td>
                                    <td>
                                        <select id="floor_status" class="select" size="1" style="height:31px;">
                                            <option value="1" selected="">使用</option>
                                            <option value="2">停用</option>
										</select>
										<label id="floor_status-error" class="error valid" for="floor_status" style="display:none;">只允许</label>
									</td>
									<td>
										<input id="floor_remarks" name="floor_remarks" type="text" class="input-text" style="width:100%" value="" placeholder="">
										<label id="floor_remarks-error" class="error valid" for="floor_remarks" style="display:none;">超出字数限制</label>
									</td>
									<td>
										<a style="text-decoration:none" class="ml-5" onClick="setFloor(1)" href="javascript:;" title="编辑">
											<i class="Hui-iconfont">&#xe6df;</i>
										</a>
										<a style="text-decoration:none" class="ml-5" href="javascript:;" title="保存">
											<i class="Hui-iconfont">&#xe632;</i>
										</a> 
									</td>
                                </tr>
                            </tbody>
                    </table>
            </div>
            
        </div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">备注：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea id="remarks" name="remarks" cols="" rows="" class="textarea"  placeholder="备注..." datatype="*10-100" dragonfly="true"></textarea><!--onKeyUp="$.Huitextarealength(this,200)"-->
				<p class="textarea-numberbar"><em class="textarea-length">最多30字</p>
				<label id="remarks-error" class="error valid" for="remarks" style="display:none;">超出字数限制</label>
			</div>
        </div>
		<div class="row cl pb-5">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button id="btn-alter" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
    </div>
	
	<!-- 遮罩层 -->
	<div id="modal-demo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" style="width:80%;">
			<div class="modal-content radius">
				<div class="modal-header">
					<h3 class="modal-title">详细设置</h3>
					<a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
				</div>
				<div class="modal-body">
					<div class="mt-10">
						<div class="form-horizontal mybg-2 bk-gray pt-5 pb-5" id="form-article-add">
							<div class="row cl mb-5">
								<label class="form-label col-xs-4 col-sm-2">当前楼层：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<select id="dormitory_floor" name="dormitory_floor" class="select" size="1" style="height:31px;">
										<option value="1" selected="">1</option>
										<option value="2">2</option>
									</select>
								</div>
								<label class="form-label col-xs-4 col-sm-2">宿舍编号：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<input  id="dormitory_id" type="number" class="input-text" style="width:100%" value="" placeholder="">
									<label id="dormitory_id-error" class="error valid" for="dormitory_id" style="display:none;">这是必填字段</label>
								</div>
								<button id="btn-select" class="btn btn-success" type="button"><i class="Hui-iconfont">&#xe665;</i> 查找</button>
							</div>
							<div class="row cl mb-5 mt-10">
								<label class="form-label col-xs-4 col-sm-2">床位数：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<input id="dormitory_beds" name="dormitory_beds" type="number" class="input-text" style="width:100%" value="" placeholder="">
									<label id="dormitory_beds-error" class="error valid" for="dormitory_beds" style="display:none;">这是必填字段</label>
								</div>
								<label class="form-label col-xs-4 col-sm-2">宿舍分类：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<select id="dormitory_property" name="dormitory_property" class="select" size="1" style="height:31px;">
										<option value="1" selected="">女生</option>
										<option value="2">男生</option>
										<option value="3">默认</option>
									</select>
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">宿舍状态：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<select id="dormitory_status" name="dormitory_status" class="select" size="1" style="height:31px;">
										<option value="1" selected="">使用</option>
										<option value="2">停用</option>
									</select>
								</div>
								<label class="form-label col-xs-4 col-sm-2">备注：</label>
								<div class="formControls col-xs-8 col-sm-3">
									<input id="dormitory_remarks" name="dormitory_remarks" type="text" class="input-text" style="width:100%" value="" placeholder="">
									<label id="id-error" class="error valid" for="dormitory_remarks" style="display:none;">这是必填字段</label>
								</div>
								<button id="btn-dormitory_alter" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 修改</button>
							</div>
						</div>
						<div id="div-dormitory" class="">
							<table class="table table-border table-bordered table-bg">
									<thead>
										<tr class="text-c">
											<th><input id="dormitory_checkbox_all" type="checkbox" value="0"></th>
											<th>公寓编号</th>
											<th>公寓名称</th>
											<th>所在楼层</th>
											<th>宿舍编号</th>
											<th>床位数</th>
											<th>宿舍分类</th>
											<th>宿舍状态</th>
											<th>备注</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="display-table">
										<tr class="text-c">
											<td><input type="checkbox" value="1"></td>
											<td>1</td>
											<td>2</td>
											<td>3</td>
											<td>4</td>
											<td>
												<input id="table_beds" type="number" class="input-text" style="width:100%">
											</td>
											<td>
												<select name="table_property" class="select" size="1" style="height:29px;">
													<option value="1" selected="">女生</option>
													<option value="2">男生</option>
													<option value="3">默认</option>
												</select>
											</td>
											<td>
												<select name="table_status" class="select" size="1" style="height:29px;">
													<option value="1" selected="">使用</option>
													<option value="2">停用</option>
												</select>
											</td>
											<td><input type="text" class="input-text" value="" placeholder=""></td>
											<td>
												<a style="text-decoration:none" class="ml-5" href="javascript:;" title="保存">
													<i class="Hui-iconfont">&#xe632;</i>
												</a> 
											</td>
										</tr>
										<tr class="text-c">
											<td><input type="checkbox" value="1"></td>
											<td>1</td>
											<td>2</td>
											<td>3</td>
											<td>4</td>
											<td>
												<input type="number" class="input-text" style="width:100%">
											</td>
											<td>
												<select name="brandclass" class="select" size="1" style="height:29px;">
													<option value="1" selected="">女生</option>
													<option value="2">男生</option>
													<option value="3">默认</option>
												</select>
											</td>
											<td>
												<select name="brandclass" class="select" size="1" style="height:29px;">
													<option value="1" selected="">使用</option>
													<option value="2">停用</option>
												</select>
											</td>
											<td><input type="text" class="input-text" value="" placeholder=""></td>
											<td>
												<a style="text-decoration:none" class="ml-5" href="javascript:;" title="保存">
													<i class="Hui-iconfont">&#xe632;</i>
												</a> 
											</td>
										</tr>
									</tbody>
								</table>
							</div>
					</div>
				</div>
				<div class="modal-footer">
					<button class="btn" onclick="pageTop()">上一页</button>
						<span><select  id="dormitory_page" name="page" class="btn">
							<option value="0" selected="">1</option>
							<option value="1">2</option>
							<option value="2">3</option>
						</select>
					</span>
					<button class="btn" onclick="pageNext()">下一页</button>
					<!--<button id="dormitory_save" class="btn btn-primary">保存</button>-->
					<button class="btn btn-default radius" data-dismiss="modal" aria-hidden="true">关闭</button>
				</div>
			</div>
		</div>
	</div>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="scripts/apartment-edit.jquery.js"></script>
<script type="text/javascript" src="scripts/apartment-floor-edit.jquery.js"></script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>